package com.tarena.lbs.marketing.mapper;

import com.tarena.lbs.pojo.marketing.dos.CouponCodeDO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CouponCodeMapper {
    void batchInsert(List<CouponCodeDO> dos);

    @Select("select * from tarena_lbs_marketing.coupon_code where status=0 and coupon_id=#{couponId}")
    List<CouponCodeDO> selectListByCouponId(Integer couponId);

    @Update("update tarena_lbs_marketing.coupon_code set status=1 where id=#{id}")
    void updateReceivedById(Integer id);
}
